const CHANGE_TYPE = Symbol('changeType');

const logHandler = {
  get: function(target, key) {
    console.log(`${key} 被读取 ${target[key]}`);
    return target[key];
  },
  set: function(target, key, value) {
    console.log(`${key} 被设置为 ${value}`);
    target[key] = value;
    target._this && target._this._update()
  }

}

export default class HandleProxy {
  [CHANGE_TYPE]

  constructor(obj) {
    obj[CHANGE_TYPE] = false
    return new Proxy(obj, logHandler)
  }

}